<?php


namespace App\Api\Models;


use Illuminate\Database\Eloquent\Model;

class LiveAnchor extends Model
{
    protected $table = 'cmc_live_anchor';

    public static function anchorInfo($id)
    {
        return self::where('id',$id)->get('is_play')->toArray();
    }

    public static function IsplayStatus($id)
    {
        return self::where('id', $id)->get('is_play')->toArray()[0]['is_play'];
    }

    static public function LiveOver($id){
        $live = self::IsplayStatus($id) - 1;
        return LiveAnchor::where('id',$id)->update(['is_play'=>$live]);
    }
}